﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing.Design;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace WHControlLib.IconFont
{
   public class FontImagePropertyEditor : UITypeEditor
    {
        public override UITypeEditorEditStyle GetEditStyle(ITypeDescriptorContext context)
        {
            //指定为模式窗体属性编辑器类型
            return UITypeEditorEditStyle.Modal;
        }
        public override object EditValue(ITypeDescriptorContext context, IServiceProvider provider, object value)
        {
            FontImageDesginFrm frm = new FontImageDesginFrm();

            if (frm.ShowDialog()==System.Windows.Forms.DialogResult.OK)
            {
             value= frm.ReturnFontIndex;
            }
            frm.Dispose();

            return value;
        }



    }
}
